﻿<script src="js/util/md5.js"></script>
<div class="modal-header">
    <button type="button" class="close"
            data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
        ×
    </button>
    <h4 class="modal-title" id="myModalLabel">
        <span translate="UserInfo.SetPassword">更改密码</span>
    </h4>
</div>
<div class="modal-body">
    <form name="form" class="bs-example form-horizontal  form-validation">
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="col-lg-3 control-label" translate="UserInfo.CurrentPassword">旧密码</label>
                    <label class="col-lg-8">
                        <input type="password" ng-model="OldPassword" maxlength="64" class="form-control" autofocus required>
                    </label>
                </div>
            </div>
        </div>
        <!-- ng-pattern="/^((?=.*[a-zA-Z]+)(?=.*[0-9])|(?=.*[a-zA-Z]+)(?=.*[~!@#￥%&*])|(?=.*[0-9])(?=.*[~!@#￥%&*]))[A-Za-z0-9~!@#$%&*]+$/" -->
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="col-lg-3 control-label" translate="UserInfo.Password">新密码</label>
                    <label class="col-lg-8">
                        <input type="password" ng-model="NewPassword" name="NewPassword" id="NewPassword"
                               class="form-control" pw-checked required>
                        <span style="color:red;" ng-show="form.NewPassword.$dirty&&form.NewPassword.$invalid">
                            <span ng-show="form.NewPassword.$error.required"
                                  translate="UserInfo.SetPassword_Msg0">
                                请输入新密码
                            </span>
                            <span ng-show="form.NewPassword.$error.pwstrength&&!form.NewPassword.$error.required"
                                  translate="UserInfo.SetPassword_Msg1">
                                请输入6-16位的数字、字母、常用符号，不能为单一组合
                            </span>
                        </span>
                    </label>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="col-lg-3 control-label" translate="UserInfo.ConfirmPassword">新密码确认</label>
                    <label class="col-lg-8">
                        <input type="password" ng-model="ConfirmPassword" class="form-control"
                               pw-checked="NewPassword" name="ConfirmPassword"
                               required>
                        <span ng-show="form.ConfirmPassword.$dirty">
                            <span style="color:red;" ng-show="form.ConfirmPassword.$error.pwmatch"
                                  translate="UserInfo.SetPassword_Msg3">输入的密码不匹配</span>
                        </span>
                    </label>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <div style="text-align:center;">
        <span ng-show="!editResult" style="color:red;" translate="UserInfo.SetPassword_Msg4">当前密码不正确</span>
    </div>
    <button type="button" class="btn btn-info" ng-click="ok()"
            ng-disabled="form.$invalid">
        <span translate="UserInfo.Save">更改</span>
    </button>
</div>